<template>
<section>
<el-form :inline="true" :rules="rules" :model="formInline"  ref="formInline" class="demo-form-inline" style="margin-left: 60px">
    <el-form-item style="width:100px">
        <el-select v-model="formInline.id" placeholder="请选择">
            <el-option label="身份证" value="id"></el-option>
            <el-option label="手机号" value="phone"></el-option>
        </el-select>
    </el-form-item>

    <el-form-item >
        <el-input v-model="formInline.phone" placeholder="请输入身份证号或者手机号" style="width: 500px"></el-input>
    </el-form-item>
    <el-form-item>
    <el-button type="primary" @click="onSubmit">查询</el-button>
</el-form-item>
</el-form>
    <el-table :data="tableData" border style="width: 100%" element-loading-text="拼命加载中">
        <el-table-column prop="enterName" label="姓名" height="200px">
        </el-table-column>
        <el-table-column prop="enterPhone" label="手机号" height="200px">
        </el-table-column>
        <el-table-column prop="enterIdcard" label="身份证号" height="200px">
        </el-table-column>
        <el-table-column prop="enterStateStr" label="审核状态" height="200px">
        </el-table-column>
    </el-table>
    <div style="align-items: center;">{{messages}}</div>
</section>
</template>
<script>
    import{getRegisterStateByid} from '../../api/api'
    export default {
        data() {
            return {
                tableData:[],
                messages:'',
                formInline: {
                    id: '',
                    phone: ''
                },
                rules: {
                    id: [
                        {required: true, message: '不能为空', trigger: 'blur'},

                    ],
                    phone: [
                        {required: true, message: '不能为空', trigger: 'blur'},
                ],
                }

            };

        },

        methods: {
            //查询审核状态
            onSubmit:function(){
                let para={

                    genre:this.formInline.id,
                    searchMessage:this.formInline.phone
                };
                getRegisterStateByid(para).then((res)=>{
                    if(res.resData !=null){
                        this.tableData=res.resData;
                    }
                    if (res.resData ==''){
                        this.$message({
                            message: '查无此人',
                            type: 'info'
                        })
                    }
                    this.$refs['formInline'].resetFields();
                });

            }
        }
    }
</script>
